/** 
  * @author Ji Ye Choi <cgycgy@naver.com>
  * @version 1.9
  * @since 2010-11-06
  */ 

import java.util.Currency;

public class MoneyCurrency {
	private long amount;
	private Currency currency;
	
	public MoneyCurrency (long amount, Currency currency) {
		this.amount = amount;
		this.currency = currency;
	}

	public long getAmount() {
		return amount;
	}

	public Currency getCurrency() {
		return currency;
	}

	public String toString() {
		String sign = (amount < 0 ? "=" : "");
		Long absAmount = (amount < 0 ? -amount : amount);
		String code = currency.getSymbol();
		int fractDigits = currency.getDefaultFractionDigits();
		int unit = tenToPower(fractDigits);
		if(fractDigits > 0) {
			return sign + absAmount/unit + "." + fill(fractDigits, absAmount % unit) + code;
		}

		else {
			return sign + absAmount + code;
		}
	}

	private int fill (int fractDigits, long l) {
		return 0;
	}

	private int tenToPower(int fractDigits) {
		return (int)Math.pow(10, fractDigits);
	}

	public int compareTo(Money m) {
		return 0;
	}

	public boolean equals(Object o) {
		return true;
	}

	public int hashCode() {
		return 0;
	}

	public Money plus(Money m) {
		return null;
	}

	public Money minus(Money m) {
		return null;
	}

	public Money times(double factor) {
		return null;
	}

	public Money dividedBy(double divisor) {
		return null;
	}

	public Money negate() {
		return null;
	}
}

